iT邦幫忙

2026 iThome 鐵人賽

DAY 13
0
AI Security

打開黑盒子:大型語言模型的機制解釋性入門系列 第 13

Day 13|SAE 拆出了 Features,但我們怎麼知道它們代表什麼?

  • 分享至 

  • xImage
  •  

上一篇我們介紹了 Sparse Autoencoder。它把模型原本的 activation x,轉換成一組通常維度更高、但每次只有少數位置啟用的 latent activations z:

https://ithelp.ithome.com.tw/upload/images/20260909/201834698ePz7lxIgg.png

這讓我們不必再把單一 neuron 當成唯一的分析單位。但 SAE 最後交給我們的,通常只是一串沒有名字的編號:

Feature #1042
Feature #5821
Feature #32741
...

它不會自動告訴我們:

Feature #32741 = City

而且「SAE 拆出了 features」只是一種方便的說法。更精確地說,SAE 學出了一套能以 sparse latents 近似重建 model activation 的 decomposition;這些 latents 是否真的對應模型原本使用的、界線清楚的 concepts,仍然需要額外驗證。因此,找到一個 SAE feature 只是分析的起點。真正困難的問題是「我們要怎麼替一個 feature 提出解釋,又怎麼知道這個解釋不是自己看圖說故事?」

Neuronpedia

今天我們會使用 Neuronpedia 作為實驗平台。Neuronpedia 是一個開源的 interpretability 平台,讓使用者探索、視覺化、測試與介入不同模型的 internal representations。[1] 對 SAE 而言,它提供了 feature dashboards、top activating examples、token-level activation testing、auto-generated descriptions、logit information 與 steering 等功能。但 Neuronpedia 現在已經不只是一個 SAE feature browser,上面也整合了許多近年的 interpretability research demos,例如:

  • Circuit Tracer:把 features 與它們之間的 attribution 畫成 graph;
  • Cross-Layer Transcoder:觀察 features 如何跨 layers 互相影響;
  • Natural Language Autoencoder:嘗試把 activation 中的資訊轉換成自然語言描述;
  • Jacobian Lens:從另一種 learned representation space 觀察模型內部資訊。

因此後面談到其他 methods 時,我們還會再次回到 Neuronpedia。不過今天先把範圍縮小,只使用它最基礎的 SAE feature dashboard,練習「看到一個沒有名字的 SAE feature 時,我們要怎麼提出並驗證它可能代表什麼?」

今天要調查的 Feature #650

我們直接使用 Neuronpedia 官方文件中的示範 feature:

Model: GPT-2 Small
Hook point: blocks.6.hook_resid_pre
SAE: 6-res_scefr-ajt
Feature index: 650
Activation density: 0.886%

Feature page:https://www.neuronpedia.org/gpt2-small/6-res_scefr-ajt/650

這裡要注意,Feature #650 本身不是一個跨模型通用的編號。只有把 model、SAE、hook point 和 feature index 一起寫出來,我們才能確定自己在談哪一個 latent。換一個 SAE,即使 index 同樣是 650,也會是完全不同的 feature。

在這個頁面上,我們可以看到幾個自動產生的 descriptions,例如:measurements in meters or feet

https://ithelp.ithome.com.tw/upload/images/20260909/20183469h72M6FiO8y.png

這給了我們第一個 hypothesis:「Feature #650 會在表示長度或距離的數值與單位附近產生較高 activation」但這還不是結論,只是一個接下來需要想辦法推翻的猜測。

第一步:從 Top Activating Examples 產生 Hypothesis

理解一個 feature 最常見的起點,是觀察哪些文本最容易讓它 activate,以及 activation 集中在哪些 tokens。假設 top examples 經常出現:

20 meters
six feet tall
a diameter of 30 cm
approximately 10 miles long

我們可能會提出「length measurement」這個解釋。但同一批 examples 也可能支持其他 hypotheses:

  • 所有帶有單位的數值;
  • technical specifications;
  • 距離描述;
  • 數字與縮寫相鄰的 token pattern;
  • 特定 measurement tokens,例如 metersfeet

所以 top activating examples 的功能不是替 feature 正式命名,而是幫助我們產生幾個可以被測試的 hypotheses。而且 top examples 具有明顯的 selection bias,它們只告訴我們「哪些 examples 讓 feature 特別強烈地 activate」,卻沒有告訴我們它在其他應該出現的情境中是否也會 activate。換句話說,top examples 比較容易讓我們看到一個 interpretation 的 precision,卻不容易告訴我們它的 coverage。

第二步:看是哪個 Token 在 Activate

Neuronpedia 可以把 feature activation 顯示在每個 token 上。

例如輸入:

The bridge is 300 meters long.

https://ithelp.ithome.com.tw/upload/images/20260909/20183469KQdwZ0ACnW.png

我們不只要問整句話是否讓 Feature #650 activate,還要觀察 activation 集中在哪些 tokens。如果最高 activation 集中在 meters,它可能和 measurement unit 有關。如果 300 也會在不同長度單位旁穩定 activate,feature 可能同時整合了 number 與 measurement context。如果它只在 meters 這個 token 出現,卻不會在 feetmilescentimeters 上出現,那麼「length measurement」可能又太寬了。(像現在圖中發現是 long 的 activation 最高,那「Feature #650 偵測數字+長度單位」這個假設或許就需要調整)

Token-level activation 能幫助我們把「這個句子會觸發 feature」修正成更精確的問題:這個 feature 在什麼 token、什麼 context 下會被觸發?

第三步:把 Description 寫成可以失敗的 Prediction

「和 measurement 有關」不是一個很好測試的 hypothesis,因為範圍太模糊,幾乎看到任何結果都能事後解釋。我們應該把它改寫得更具體,例如:

H1:當 token 表示長度或距離的 measurement unit,而且出現在數值描述中時,Feature #650 應該產生較高 activation。它不應該對所有數字、所有單位或所有 technical text 都有相同反應。

現在這個 hypothesis 會產生可以被檢驗的 predictions。

Expected to Activate

The bridge is 300 meters long.
The table is six feet wide.
The object has a diameter of 20 centimeters.
She ran five miles.

Hard Negatives

The bridge opened 300 years ago.
The package weighs 20 kilograms.
The budget was five million dollars.
The recipe requires two cups of flour.

這些例子保留了數字或 measurement-like structure,卻把語意從 length 改成時間、重量、金錢與容量。實際看一個案例:

https://ithelp.ithome.com.tw/upload/images/20260909/20183469keVO7bCgXl.png

發現 Activation 最高的是 kilograms,所以我們的 H1 就被反駁了。

Minimal Pairs

The bridge is 300 meters long.
The bridge is 300 years old.
The object is five centimeters wide.
The object weighs five kilograms.
She ran five miles.
She earned five dollars.

Minimal pair 的重點,是盡量只改變一項因素。如此一來,如果 activation 發生變化,我們才比較知道差異可能來自 measurement type,而不是句型、數字或其他無關因素。如果 Feature #650 對所有帶數字的句子都很強,那麼 hypothesis 應該改成「numeric expression」。如果它只對 metersfeet 有反應,卻忽略其他長度單位,那麼 description 可能需要縮小。如果它對重量、容量與金錢也同樣有反應,那麼「length measurement」就可能是錯的。Feature interpretation 的目標不是證明自己原本猜對,而是找到哪個結果會迫使我們改變說法。

https://ithelp.ithome.com.tw/upload/images/20260909/20183469XODBssIvtr.png

不要只記錄有沒有 activate

實際測試時,也不要只截一張 activation 很高的圖片。我們可以替每個 example 記錄:

Example
Expected result
Highest-activating token
Maximum activation
Observed result
Supports or contradicts H1

如果想稍微量化,可以把一句文字中 Feature i 的最大 activation 定義成:

https://ithelp.ithome.com.tw/upload/images/20260909/201834695LV5FJeg06.png

其中:

  • s 是輸入文字;
  • t 是 token position;
  • z_i(s,t) 是 Feature i 在該位置的 activation。

接著比較 positive examples、hard negatives 與 minimal pairs 的 A_i(s)。我們不一定需要立刻找出一個完美 threshold。即使只是確認 positive examples 整體比 hard negatives 更容易產生高 activation,也比挑選一兩個成功案例更有說服力。測試內容也應該涵蓋不同句型、單位和 tokenization,避免我們其實只發現了某個固定字串或 token pattern。

第四步:用 Logit Information 交叉檢查

Neuronpedia 的 feature dashboard 也會列出 positive 和 negative logits。在 Feature #650 的頁面上,較高的 positive logits 包含:

diameter
radius
circumference

這和 length/measurement hypothesis 相容,因為這些 tokens 都與幾何尺寸有關。但這是一種不同於 activating examples 的 evidence:

  • Activating examples 告訴我們:什麼輸入通常會讓 feature activate?
  • Logit information 告訴我們:這條 decoder direction 和哪些 output tokens 具有較直接的關係?

兩者互相支持時,interpretation 會更完整。但 positive logits 仍然不是 feature 的自然語言定義,也不代表模型每次輸出這些 tokens 時都依靠這個 feature。模型後面還有其他 layers、normalization 與 components。Feature direction 對 vocabulary 的直接關係,只是整段 computation 中的一部分。

第五步:真的去 Steer 它

前面的 activation examples、minimal pairs 與 logits,主要都在觀察這個 feature 和哪些輸入或輸出相關。若想取得更進一步的證據,我們可以直接改變這個 feature 的 activation,看看模型行為是否按照 hypothesis 所預測的方向變化。這種做法稱為 Activation Steering。它的基本概念是:模型運算到某一層時,人為沿著某個 direction 修改 activation,再讓模型繼續完成後面的 computation。

對支援 steering 的模型與 features,Neuronpedia 也允許我們把某個 feature direction 加入 model activation,再觀察輸出如何改變。[1] 概念上可以寫成:

https://ithelp.ithome.com.tw/upload/images/20260909/201834693WVwezWxGt.png

其中:

  • x_{l,t} 是 layer l、position t 原本的 model activation;
  • d_i 是 Feature i 的 decoder direction;
  • alpha 是 steering strength。

比較好的實驗不是只挑一個成功 prompt,而是:

  1. 先記錄沒有 steering 的 baseline;
  2. 使用數個不同的 steering strengths;
  3. 在多種 prompts 上重複測試;
  4. 檢查效果是否隨 strength 穩定變化;
  5. 同時記錄 repetition、語法破壞等 off-target effects。

如果提高某個 measurement-related feature 的方向後,模型更容易產生長度、距離或尺寸相關內容,我們就得到一條 intervention evidence:在這種 intervention 下,增加這條 direction 足以讓模型更傾向產生 measurement-related behavior。

不過這仍然不能證明模型在正常 computation 中一定使用它,也不能證明所有 measurement behavior 都由這個 feature 負責。Steering 測試的是「改變它,能不能造成期望的效果?」它沒有直接測試模型平常是不是靠它完成這項 computation。

後面的文章會再專門回到 Activation Steering,討論 direction 如何選擇、steering strength 如何設定,以及為什麼成功控制模型行為仍不等於完整理解它的 mechanism。這一篇只需要先記住:Steering 能把我們替 feature 寫下的 description,轉換成一項可以透過 intervention 檢驗的 prediction。

Auto-Interpretation 的分數代表什麼?

Neuronpedia 上許多 descriptions 並不是人類逐一撰寫,而是由另一個 language model 根據 activating examples 自動產生。這通常被稱為 auto-interpretation。OpenAI 在 2023 年曾展示一套 automated interpretability 流程 [2]:

  1. 把一個 neuron 的 activating examples 交給 GPT-4;
  2. 請 GPT-4 產生自然語言 explanation;
  3. 再讓模型根據 explanation 預測新的 activation;
  4. 比較預測 activation 與真正 activation,替 explanation 評分。

這比單純問「description 聽起來合不合理」更進一步,因為 explanation 必須對沒看過的 examples 做出 prediction。但高分仍然只代表這段 description 能在目前的 scoring procedure 下,解釋或預測一部分 activation behavior。它不會自動證明:

  • description 捕捉了 feature 的所有用途;
  • 沒有更精確的替代解釋;
  • feature 對模型行為具有預期的 causal role;
  • 另一個 SAE 也會學到相同 feature。

因此,auto-generated description 最好被理解成一個可以快速產生與初步篩選 hypotheses 的工具,而不是自動替 feature 宣布正確答案。

Top Examples 很乾淨,仍然可能漏掉一半故事

這裡可以把 feature interpretation 分成兩個問題:

Precision

當 feature 強烈 activate 時,我們提出的 description 是否通常適用?如果 top examples 幾乎都是 length measurements,這部分可能很好。

Coverage

當 description 所描述的現象出現時,feature 是否通常都會 activate?如果它會對 meters activate,卻總是漏掉 centimeters,那麼它可能只捕捉了這個 concept 的一部分。

Top activating examples 很容易讓我們看到 precision,卻不容易揭露 coverage。Feature splitting 和 feature absorption 之所以麻煩,正是因為一個 feature page 可能看起來非常乾淨,卻沒有完整涵蓋我們以為它代表的現象。[4] 因此,「這個 feature 的 top examples 很一致」和「這個 feature 完整表示了某個 concept」是兩個不同的 claims。

SAE Feature 是唯一、完整的答案嗎?

即使某個 feature 通過了前面的 examples、counterexamples 與 steering tests,仍然存在一個更根本的問題:SAE 是在發現模型原本就存在的基本單位,還是另外學出一套方便分析的 decomposition?

一套理想的 feature dictionary 可能具有三項性質:

  • Unique:不同訓練設定都能找到相近的 features;
  • Complete:重要資訊都能被這套 features 捕捉;
  • Atomic:每個 feature 已經是無法再拆解的基本單位。

但後來的研究開始質疑,現有 SAE 是否真的具備這些性質。Leask 等人在 2025 年提出 SAE stitching 與 meta-SAE。他們發現,較小的 SAE 可能漏掉較大 SAE 才能捕捉的資訊;另一方面,較大 SAE 中看似單一的 latent,又可能被拆成多個更基礎的 components。[3] 例如,一個看似代表 Einstein 的 feature,可能進一步分解成:

scientist
Germany
famous person
space and astronomy

這表示 SAE feature 不一定是完整且不可再分解的「概念原子」。Dictionary size、sparsity constraint、architecture 與 training process,都可能影響最後得到的 decomposition。

但問題不只在於不同 SAEs 可能得到不同的 features。我們還需要問:這些看似可解釋的 features,真的反映了模型透過訓練學會的 structure 嗎?

Heap 等人在 2025 年把 SAE 訓練在隨機初始化或重新隨機化的 Transformers 上,發現這些模型同樣能產生看似可解釋的 SAE latents;使用現有的 auto-interpretability pipeline 評估時,分數甚至和 trained models 相近,許多常見的 SAE quality metrics 也無法清楚區分兩者。[7] 不過,隨機模型中的 latents 更常只和少數特定 tokens 綁定,而不像 trained model 後期 layers 中可能出現的抽象 features。

這個結果不表示 SAE 完全沒有用,而是指出「一個 latent 容易被寫成自然語言 description,不代表它捕捉到了模型透過訓練形成的 computation」它也可能反映輸入文字本身的稀疏結構,或暴露目前的 auto-interpretability metrics 無法區分「容易描述」和「對模型 computation 有意義」。

另一個仍在發展中的問題是:我們要怎麼比較不同 SAEs?

SAEBench 嘗試用 reconstruction、feature disentanglement、interpretability 與 downstream applications 等不同 metrics 評估 SAE。[5] 但 2026 年一項後續 audit 發現,其中兩項 metrics 在常用設定下通不過多項 reliability checks;其他 metrics 也可能具有比預期更高的 noise,難以區分相近的 SAE variants。[6] 這表示我們目前甚至還沒有一套完全可靠的方法,可以判斷兩個 SAEs 中哪一個提供了更好的 decomposition。

除了 feature quality 本身,我們也可以直接測試 SAE 對實際 downstream task 是否有幫助。Google DeepMind 的 Mechanistic Interpretability team 在 2025 年報告了一項 negative result:在他們測試的 harmful-intent out-of-distribution probing task 上,使用 SAE latents 的 sparse probes 不如直接使用 Residual Stream 的 linear probe;透過 SAE reconstruction 訓練的 probe 也出現 performance loss,表示 SAE reconstruction 可能遺失了和任務相關的資訊。[8] 因此,該團隊決定暫時降低 fundamental SAE research 的優先級,轉而探索其他方向。但這並不是 Google DeepMind 宣布「放棄 SAE」。研究者明確表示,SAE 仍然會留在他們的工具箱中,也可能適合用來探索與 debug 某些模型行為;他們質疑的是 SAE 在目前形式下是否真能成為 interpretability 的通用突破。

這些研究從不同角度提醒我們:SAE feature 比較適合被視為一套實用、可以接受實驗檢驗的分析單位,而不是模型內部唯一且客觀存在的概念清單。漂亮的 feature dashboard 和流暢的自然語言 description 只是 hypothesis 的起點;真正的評估還需要 random-model controls、簡單 baseline、downstream tasks,以及能否預測 intervention 的結果。

所以今天替 Feature #650 提出 interpretation 時,我們不是在宣布自己找到了模型真正的「measurement neuron」。我們是在建立一個具有適用範圍、能產生 predictions,也可能被反例推翻的 mechanistic hypothesis。

什麼時候才算理解了一個 Feature?

沒有單一實驗能替 feature interpretation 蓋上「已證實」的印章,但我們可以逐步累積不同 evidence:

  1. **Candidate description:**從 top activating examples 提出初步 hypothesis。
  2. **Token-level localization:**確認 activation 發生在哪些 tokens 與 contexts。
  3. **Held-out prediction:**使用新的 positive examples、hard negatives 與 minimal pairs,檢查 hypothesis 能不能預測 activation。
  4. **Output association:**查看 decoder direction 和哪些 logits 具有直接關係。
  5. **Intervention evidence:**透過 steering 或 ablation,測試修改 feature 是否造成預期的行為變化。
  6. **Boundary testing:**主動尋找 description 無法解釋的反例,確認 feature 的範圍與限制。

最終我們得到的,不應該只是一個標籤:

Feature #650 = measurement

而應該是一個帶有適用範圍的 hypothesis。假設前面的測試結果確實支持 H1,例如我們可以寫成:

Feature #650 經常在數值化的長度與距離描述附近 activate,
其 decoder direction 和部分尺寸相關 tokens 對齊;
在目前測試過的 prompts 中,它能區分 length measurements
與若干數字、時間、重量及金錢的 hard negatives。

但它是否涵蓋所有 length-related contexts,
以及模型在正常 computation 中是否依賴它,
仍需要更多測試。

這才是「理解一個 feature」比較接近的形式。

今天真正要學的是如何懷疑自己的解釋

使用 Neuronpedia 最有價值的地方,不是找到一個看起來很酷的 feature,然後替它取一個名字。真正重要的是把 feature page 當成一個研究起點:

觀察 examples
      ↓
提出 hypothesis
      ↓
寫出 predictions
      ↓
設計 minimal pairs 與 counterexamples
      ↓
測試 activations、logits 與 intervention
      ↓
修改或推翻 explanation

Feature interpretation 不是替 latent 貼標籤,而是建立一個可以被反駁的模型。

今天我們主要在分析某一層中的單一 feature。但一本 feature dictionary 還不是一個演算法:它沒有直接告訴我們上一層的 features 如何產生下一層的 features,也沒有告訴我們這些 features 如何連成完整 computation。下一篇,我們會從單層的 activation decomposition 往前一步,介紹 Transcoder 與 Cross-Layer Transcoder:不只問模型裡有哪些 features,而是問這些 features 如何一步步互相轉換。

參考資料與延伸閱讀

[1] Neuronpedia, open-source platform and documentation for exploring, testing, and steering model internals. https://www.neuronpedia.org/, https://docs.neuronpedia.org/features

本文使用的 Feature #650:https://www.neuronpedia.org/gpt2-small/6-res_scefr-ajt/650

[2] Bills, S., Cammarata, N., Mossing, D., et al., “Language Models Can Explain Neurons in Language Models”, OpenAI, 2023. https://openai.com/index/language-models-can-explain-neurons-in-language-models/

[3] Leask, P., Bussmann, B., Pearce, M., et al., “Sparse Autoencoders Do Not Find Canonical Units of Analysis”, International Conference on Learning Representations (ICLR), 2025. https://proceedings.iclr.cc/paper_files/paper/2025/hash/84ca3f2d9d9bfca13f69b48ea63eb4a5-Abstract-Conference.html

[4] Chanin, D., Wilken-Smith, J., Dulka, T., et al., “A Is for Absorption: Studying Feature Splitting and Absorption in Sparse Autoencoders”, Advances in Neural Information Processing Systems (NeurIPS), 2025. https://proceedings.neurips.cc/paper_files/paper/2025/hash/764ff7477b8e24dbe01531f6791e8bdf-Abstract-Conference.html

[5] Karvonen, A., Rager, C., Lin, J., et al., “SAEBench: A Comprehensive Benchmark for Sparse Autoencoders in Language Model Interpretability”, International Conference on Machine Learning (ICML), 2025. https://proceedings.mlr.press/v267/karvonen25a.html

[6] Chanin, D., “Are Sparse Autoencoder Benchmarks Reliable?”, 2026. https://arxiv.org/abs/2605.18229

[7] Heap, T., Lawson, T., Farnik, L., & Aitchison, L., “Sparse Autoencoders Can Interpret Randomly Initialized Transformers”, 2025. https://arxiv.org/abs/2501.17727

[8] Smith, L., Rajamanoharan, S., Conmy, A., et al., “Negative Results for SAEs On Downstream Tasks and Deprioritising SAE Research”, Google DeepMind Mechanistic Interpretability Team Progress Update, 2025. https://www.alignmentforum.org/posts/4uXCAJNuPKtKBsi28/sae-progress-update-2-draft


上一篇
Day 12|如果一個 Neuron 疊加了多種「概念」,我們要怎麼分析?
下一篇
Day 14|Feature 的意義找到了,但模型怎麼使用它?
系列文
打開黑盒子:大型語言模型的機制解釋性入門27
圖片
  熱門推薦
圖片
{{ item.channelVendor }} | {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言